import 'package:nyh_motorcade_app/entity/check_version_entity.dart';

checkVersionEntityFromJson(CheckVersionEntity data, Map<String, dynamic> json) {
	if (json['version'] != null) {
		data.version = json['version'].toString();
	}
	if (json['downloadUrl'] != null) {
		data.downloadUrl = json['downloadUrl'].toString();
	}
	if (json['versionDescribed'] != null) {
		data.versionDescribed = json['versionDescribed'].toString();
	}
	if (json['forcedUpdateOrNot'] != null) {
		data.forcedUpdateOrNot = json['forcedUpdateOrNot'] is String
				? int.tryParse(json['forcedUpdateOrNot'])
				: json['forcedUpdateOrNot'].toInt();
	}
	return data;
}

Map<String, dynamic> checkVersionEntityToJson(CheckVersionEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['version'] = entity.version;
	data['downloadUrl'] = entity.downloadUrl;
	data['versionDescribed'] = entity.versionDescribed;
	data['forcedUpdateOrNot'] = entity.forcedUpdateOrNot;
	return data;
}